package com.bigpang.framework.redis.subscribe;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;

/**
 * @Author YongQiang
 * @Date 2021/6/9 11:16
 * @Version 1.0
 */
public class RedisSub {
    public static void main(String[] args) {

        Jedis jedis = new Jedis("10.130.132.137",6379);
        jedis.subscribe(new JedisPubSub() {
            @Override
            public void onMessage(String channel, String message) {
                System.out.println(message);
            }
        }, "channel");
        jedis.close();
    }
}
